home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: ritz.mordor.com!news
- From: benjamin@ritz.mordor.com (Joseph Thomas)
- Subject: Is it possible to #include <#defined or -D 'ed macro>?
- X-Newsreader: Gnus v5.1
- X-Nntp-Posting-User: benjamin
- Sender: benjamin@ritz.mordor.com
- Organization: Mordor International
- Message-ID: <5rbuntgqp0.fsf@ritz.mordor.com>
- X-Nntp-Posting-Host: ritz.mordor.com
- Date: Wed, 24 Jan 1996 22:42:35 GMT
-
- Does anyone know a way of having an include statement that can include
- a file, based on a -D <MACRO_NAME> flag passed to the compiler, to
- give the effect of:
-
-
- #include <SOURCE>
-
-
-
- cc -D SOURCE=source_a.h
-
- includes source_a.h
-
- and
-
- cc -D SOURCE=source_b.h
-
- includes source_b.h, (this doesn't seem to work with the xlc compiler)
-
- or at least explain a method whereby I can conditionally include one
- of a few different headers at various spots in my source, based on a
- -D passed to the compiler?
-
- TIA,
- Joe
-
-
-
-